<template>
  <div class="employees-container">
    <div class="app-container">
      <el-card>
        <el-tabs>
          <el-tab-pane label="登录账户设置">
            <LoginSetting :detail-info="detailInfo" />
          </el-tab-pane>
          <el-tab-pane label="个人详情">
            <Detailinfo :detail-info="detailInfo" />
          </el-tab-pane>
        </el-tabs>
      </el-card>
    </div>
  </div>
</template>

<script>
import { getUserDetailByIdAPI } from '@/api/user'
import LoginSetting from '@/views/employees/components/login-setting'
import Detailinfo from '@/views/employees/components/detail-info'
export default ({
  components: {
    LoginSetting,
    Detailinfo
  },
  data() {
    return {
      detailInfo: {} // 员工详情信息
    }
  },
  created() {
    this.getUserDetailById()
  },
  methods: {
    // 通过id获取用户信息
    async  getUserDetailById () {
      const res = await getUserDetailByIdAPI(this.$route.params.id)
      console.log(res)
      this.detailInfo = res
    }
  }
})
</script>
